import java.math.BigInteger;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 六六大顺
 * User: DELL
 * Date: 2024-05-18
 * Time: 12:33
 */
public class Main7 {
    /**
     * 36
     * 4356
     * 443556
     * 44435556
     * 4444355556
     * 444443555556
     * 44444435555556
     * 4444444355555556
     *
     * @param args
     */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        StringBuilder builder = new StringBuilder("36");
        BigInteger res = new BigInteger("0");
        for (int i = 1; i <= n; i++) {
            BigInteger bigInteger = new BigInteger(builder.toString());
            res = res.add(bigInteger);
            builder.insert(0, "4");
            builder.insert(1 + i, "5");
        }
        System.out.println(res);
    }
}
